//
//  AddView.m
//  PulldownView
//
//  Created by 1 1 on 15/12/4.
//  Copyright © 2015年 Hiccup. All rights reserved.
//

#import "AddView.h"

@implementation AddView
{
    NSArray * titleArray;
}


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        
        titleArray = @[@"mrjBOX",@"未命名1",@"未命名1"];
        
        UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width-80, 0, 90, 101)];
        imageView.image = [UIImage imageNamed:@"我的、发帖背景@2x.png"];
        [self addSubview:imageView];
        
        
        UITableView * _tableView = [[UITableView alloc] initWithFrame:CGRectMake(imageView.frame.origin.x-8, 25, 140, 80) style:UITableViewStylePlain];
        _tableView.backgroundColor = [UIColor clearColor];
//        _tableView.separatorStyle = NO;
        _tableView.delegate =self;
        _tableView.dataSource =self;
        _tableView.userInteractionEnabled = NO;
        _tableView.separatorInset = UIEdgeInsetsMake(0,20, 0, 15);
        [_tableView setSeparatorColor:[UIColor whiteColor]];
        [self addSubview:_tableView];
    }
    
    return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString * str=@"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:str];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:str];
    }
    
    if (indexPath.row==0) {
        cell.imageView.image=[UIImage imageNamed:@"修改1@2x.png"];
        cell.textLabel.text = @"发布";
        cell.detailTextLabel.textColor = [UIColor whiteColor];
    }
    if (indexPath.row==1) {
        cell.imageView.image=[UIImage imageNamed:@"我的@2x.png"];
        cell.textLabel.text = @"我的";
    }
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.backgroundColor = [UIColor clearColor];
    
    return cell;
}








/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
